#ifndef _TASKQUEUE__H
#define _TASKQUEUE__H
#include <queue>
#include <mutex>
#include <functional>
#include <condition_variable>

using namespace std;
using ElemType = function<void()>;

class TaskQueue{
   private:
   size_t _queSize;
   queue<ElemType> _que;
   mutex _mutex;
   condition_variable _notFull;
   condition_variable _notEmpty;
   bool _flag;
   public:
   TaskQueue(size_t queSize);
   ~TaskQueue();
   void push(ElemType&& );
   ElemType pop();
   bool full();
   bool empty();
   void wakeup();
};

#endif

